using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace UnityGameFramework.Editor
{
    [CustomEditor(typeof(GameFrameworkSettings),true)]
    public class GameFrameworkSettingsEditor : UnityEditor.Editor
    {
        public override void OnInspectorGUI()
        {
            EditorGUI.BeginChangeCheck();
            DrawDefaultInspector();
            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
            }
        }

        private void OnDisable()
        {
            GameFrameworkSettings.Save();
        }

        [MenuItem("Game Framework/Setting", priority = 0)]
        private static void ConfigurationMenu()
        {
            SettingsService.OpenProjectSettings("Project/UnityGameFramework");
        }
    }
}
